﻿@model IEnumerable<IfSoft.OA.Entities.BankBill>

@{
    ViewBag.Title = "Index";
}
@using IfSoft.OA.Business;

<h2>银行付款申请</h2>

<div class="text-right">@Html.ActionLink("新建申请单", "Create")</div>

@using (Html.BeginForm())
{    
    <table class="search-table">    
        <tr><td colspan="4">查询条件</td></tr>    
        <tr>
            <th>付款公司</th>
            <td><input id="payCompany_S" name="payCompany_S"  type="text" value='@ViewBag.PayCompany_S' /></td>
            <th>付款银行</th>
            <td><input id="payBank_S" name="payBank_S"  type="text" value='@ViewBag.PayBank_S'/></td>
        </tr>
        <tr>
            <th>付款方式</th>
            <td>@Html.DropDownList("PayType_S", ViewBag.PayTypes as SelectList)</td>
            <th>票据号码</th>
            <td><input id="payNoteNo_S" name="payNoteNo_S"  type="text" value='@ViewBag.PayNoteNo_S' /></td>
        </tr>
        <tr>
            <th>收款公司</th>
            <td><input id="receiveCompany_S" name="receiveCompany_S"  type="text"  value='@ViewBag.ReceiveCompany_S'/></td>
            <th>收款银行</th>
            <td><input id="receiveBank_S" name="receiveBank_S"  type="text"  value='@ViewBag.ReceiveBank_S'/></td>
        </tr>
        <tr>
            <th>收款帐号</th>
            <td><input id="receiveAccountNo_S" name="receiveAccountNo_S"  type="text"  value='@ViewBag.ReceiveAccountNo_S'/></td>
            <th>状态</th>
            <td><input id="step_S" name="step_S"  type="text" /></td>
        </tr>
        <tr><td colspan="4" class="text-right"> <button type="submit" >查询</button></td></tr>         
    </table>    
}

<table class="list-table">
<tr><td colspan="7">查询结果</td></tr>  
    <tr>
        <th>付款公司</th>
        <th>付款银行</th>
        <th>付款方式</th>       
        <th>收款公司</th>
        <th>收款银行</th>        
        <th>金额</th>
        <th>操作</th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.PayCompany)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PayBank)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PayType)
        </td>       
        <td>
            @Html.DisplayFor(modelItem => item.ReceiveCompany)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ReceiveBank)
        </td>       
        <td>
            @Html.DisplayFor(modelItem => item.Amount)
        </td>
        
        <td>
            @Html.ActionLink("详细", "Details", new { id = item.Id }) |
            @if (BankBillHelper.IsCanEditOrSubmit(User.Identity.Name, item))
            {
                @Html.ActionLink("编辑", "Edit", new { id = item.Id });
                @Html.Raw("|");                 
            }
            
            @if (BankBillHelper.IsCanApproveOrDeny(User.Identity.Name, item))
            {
                @Html.ActionLink("批准", "Approve", new { id = item.Id });
                @Html.Raw("|");                                                                     
                @Html.ActionLink("拒绝", "Deny", new { id = item.Id })             
            }       
            @*@Html.ActionLink("删除", "Delete", new { id = item.Id })*@
        </td>
    </tr>
}

</table>
